﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace Ideas2Realize.Helpers
{
    public static class SecurityHelper
    {
        public static string GetHash(string password)
        {
            byte[] buffer = Encoding.Default.GetBytes(password);

            MD5 md5 = MD5.Create();
            byte[] hash = md5.ComputeHash(buffer);

            string hashed = "";

            foreach (byte b in hash)
                hashed += b.ToString("x2");

            return hashed;
        }
    }
}
